package AST;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

public class AndExpr {
	private List<ArithExpr> arithExprList = new ArrayList<ArithExpr>();

	public void print() {
		System.out.println("AndExpr");
	}

	public AndExpr(List<ArithExpr> arithExprList) {
		print();
		this.arithExprList = arithExprList;
	}

	public List<ArithExpr> getArithExprList() {
		return arithExprList;
	}

	public void setArithExprList(List<ArithExpr> arithExprList) {
		this.arithExprList = arithExprList;
	}

	public void genC(PW pw) {
		Iterator<ArithExpr> itArith = arithExprList.iterator();

		itArith.next().genC(pw);
		while (itArith.hasNext()) {
			pw.print(" && ");
			itArith.next().genC(pw);
		}

	}

}
